package com.tongji.seller.command
{
	import com.tongji.seller.events.AddStoreSceneEvent;
	import com.tongji.seller.service.AddStoreSceneService;
	import com.tongji.seller.service.UserSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author jiarong
	 * 2011-12-8
	 *
	 */
	
	public class AddStoreSceneCommand extends Command
	{
		[Inject]
		public var event:AddStoreSceneEvent;
		
		[Inject]
		public var service:UserSceneService;
		
		[Inject]
		public var service2:AddStoreSceneService;
		public function AddStoreSceneCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case AddStoreSceneEvent.ADD_STORE_FAVORITE_SCENE:
					service2.addStoreFavoriteScene(event.userId, event.scjId);
					break;
				case AddStoreSceneEvent.ADD_STORE_USER_SCENE:
					service.addStoreUserScene(event.spara);
					break;
				case AddStoreSceneEvent.ADD_STORE_USER_SYSTEM_SCENE:
					service2.addStoreUserSystemScene(event.userId, event.sIdArr);
			}
		}
	}
}